www.gusucode.com > 基于VBLAST-OFDM的MATLAB SIMULATION,图形化界面,并且给出了各仿真图 > 基于VBLAST-OFDM的MATLAB SIMULATION,图形化界面,并且给出了各仿真图/vblast-ofdm simulation/rx_estimate_channel.m

    function channel_estimate = rx_estimate_channel(freq_tr_syms, cir, SimulationParameters)

global SimulationConstants;

[n_tx_antennas, n_rx_antennas] = get_n_antennas(SimulationParameters);
fft_length=SimulationParameters.FFTPoints;
    if SimulationParameters.ChannelEstimation_LSE
       % Estimate from training symbols
       if ~SimulationParameters.TxDiv
          for rx_ant=1:n_rx_antennas
             mean_symbols = mean(squeeze(freq_tr_syms(rx_ant,:,:)).');
             channel_estimate(rx_ant,:) = mean_symbols.*conj(SimulationConstants.LongTrainingSymbols);
             %FFT estimation
            if SimulationParameters.ChannelEstimation_FFT==1
               temp2=ifft(channel_estimate(rx_ant,:));
               y=[temp2(1:16) zeros(1,SimulationConstants.NumDataSubc-16)];
               channel_estimate(rx_ant,:)=fft(y);
            end
          end
          channel_estimate = channel_estimate.';
       else
          for tx_ant = 1:n_tx_antennas   
              for rx_ant=1:n_rx_antennas
                tr_symbol = squeeze(freq_tr_syms(rx_ant, :, tx_ant));      
                channel_estimate((rx_ant-1)*n_tx_antennas+tx_ant,:) = ...
                           tr_symbol.*conj(SimulationConstants.LongTrainingSymbols*sqrt(1/SimulationParameters.TxDiv));
                       %FFT estimation
                  if SimulationParameters.ChannelEstimation_FFT==1
                    temp2=ifft(channel_estimate((rx_ant-1)*n_tx_antennas+tx_ant,:));
                    y=[temp2(1:16) zeros(1,SimulationConstants.NumDataSubc-16)];
                    channel_estimate((rx_ant-1)*n_tx_antennas+tx_ant,:)=fft(y);
                  end
              end
          end
          channel_estimate = channel_estimate.';
       end
    else
       % Known channel estimate
       channel_estimate = fft(cir, fft_length, 2);
       reorder = [(fft_length/2)+1:fft_length 1:fft_length/2];
       channel_estimate(:,reorder) = channel_estimate;
       channel_estimate=channel_estimate.';
       %zero padding option
       if SimulationParameters.ZeroPad==1
           num_data_carriers=SimulationConstants.NumDataSubc;
           x=fft_length-num_data_carriers;
           channel_estimate=channel_estimate([x/2:x/2+num_data_carriers/2-1 ((x/2+num_data_carriers/2)+1):fft_length-(fft_length-num_data_carriers)/2],:);
       end
   end